package com.zzhardy.example.excelsExample;


import java.util.ArrayList;
import java.util.List;

import cn.zzhardy.utils.poi.ExcelCenter;
import cn.zzhardy.utils.result.AjaxResult;
import com.zzhardy.example.common.SysDept;
import com.zzhardy.example.common.SysUser;
import org.junit.Test;

/**
 * @Author：Hardy
 * @Date：2021/3/27
 * @Function:
 */
public class ExcelExample {
    @Test
    public void createMoreExcels() {
        List<SysUser> list    = new ArrayList<>();
        SysUser       sysUser = new SysUser();
        SysDept       sysDept = new SysDept();
        sysDept.setDeptName("测试部门");
        sysDept.setLeader("测试部门领导");
        sysUser.setDept(sysDept);
        sysUser.setNickName("n昵称");
        sysUser.setUserName("dsds");
        list.add(sysUser);
        list.add(sysUser);
        list.add(sysUser);
        list.add(sysUser);
        list.add(sysUser);
        ExcelCenter<SysUser> util = new ExcelCenter<>(SysUser.class);
        AjaxResult           form = util.exportExcel(list, "form");
        System.out.println(form.toString());
    }
}
